Java.perform(function () {
    let g0 = Java.use("h6.g0");
    g0["a"].implementation = function (str) {
        console.log(`g0.a is called: str=${str}`);
        let result = this["a"](str);
        console.log(`g0.a result=${result}`);
        console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()));
        return result;
    };

    let o = Java.use("g4.o");
    o["x"].implementation = function (str, str2, str3, str4, str5) {
        console.log(`o.x is called: str=${str}, str2=${str2}, str3=${str3}, str4=${str4}, str5=${str5}`);
        let result = this["x"](str, str2, str3, str4, str5);
        console.log(`o.x result=${result}`);
        console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()));

        return result;
    };
    o["f"].implementation = function () {
        console.log(`o.f is called`);
        let result = this["f"]();
        console.log(`o.f result=${result}`);
        console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()));

        return result;
    };
    let l1 = Java.use("h6.l1");
    l1["h"].implementation = function (map, str) {
        console.log(`l1.h is called: map=${map}, str=${str}`);

        if (map != null) {
            let Map = Java.use("java.util.Map");
            let mapObj = Java.cast(map, Map);
            console.log("Map: " + mapObj.toString());
        }

        let result = this["h"](map, str);
        console.log(`l1.h result=${result}`);
        console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()));
        return result;
    };
})